<script>
    $(document).ready(function($)
    {
        function runEffect()
        {
            $( "div.panel" ).toggle('slide', function() {
            });
        };

        $( ".list" ).click(function()
        {
            runEffect();
            return false;
        });
    });
</script>

<div class="tales_stats_menu">
    <ui>
        <li class="tales_of_deonia"><?php echo __(LANG_TALES_OF_DEONIA)?></li>
    </ui>
</div>

<!-- 유저 셋팅 메뉴 -->
<div class="tales_stats_menu">
    <ul>
        <li class="actions">
            <?php echo $this->Html->link(__(LANG_OTHER_USER), '', array('class' => 'list'));?>
        </li>
        <?php if(CakeSession::check('tbl_auth')) {?>
            <li class="actions">
                <?php echo $this->Html->link(__('Info Edit'), array(
                    'action' => 'user_select_edit',
                    'id' => $this->passedArgs['id'],
                    'search_value' => $this->passedArgs['search_value'],
                    'char_serial' => empty($char_serial) ? '' : $char_serial,
                ));?>
            </li>
            <li class="actions">
                <?php echo $this->Html->link(__(LANG_SETTING . ' & ' . LANG_SEND_GIFT), array(
                    'controller' => 'Setting',
                    'action' => 'setting_index',
                    'id' => $this->passedArgs['id'],
                    'search_value' => $this->passedArgs['search_value'],
                ));?>
            </li>
        <?php }?>
    </ul>
</div>

<div>
    <div class="panel ui-widget-content ui-corner-all">
        <?php echo $this->element('slide_user_search',array(
                'id' => $this->passedArgs['id'],
                'search_value' => $this->passedArgs['search_value'],
                )
        ); ?>
    </div>
    <div class="account_info_div">
        <div class="account_info_div_left">
            <div class="account_info_div_left_one">
                <div class="div_title"><?php echo __(LANG_ACCOUNT_INFO)?></div>
                <table>
                    <tr>
                        <th class="user" style="width: 110px"><?php echo __(LANG_NICKNAME)?></th>
                        <td ><?php echo empty($user_data['tbl_account']['nickname'])?'':$user_data['tbl_account']['nickname']?></td>
                    </tr>
                    <tr>
                        <th class="user"><?php echo __(LANG_GEM)?></th>
                        <td><?php echo empty($user_data['tbl_account']['gem'])?0:$user_data['tbl_account']['gem']?></td>
                    </tr>
                    <tr>
                        <th class="user"><?php echo __(LANG_BLOCK)?></th>
                        <td><?php echo !isset($user_data['tbl_account']['block'])? 'null' : blockStatus($user_data['tbl_account']['block'])?></td>
                    </tr>
                    <tr>
                        <th class="user"><?php echo __(LANG_CREATE_ACCOUNT)?></th>
                        <td><?php echo empty($user_data['tbl_account']['register_date'])?'':$user_data['tbl_account']['register_date']?></td>
                    </tr>
                    <tr>
                        <th class="user"><?php echo __(LANG_LAST_LOGIN)?></th>
                        <td><?php echo empty($user_data['tbl_account']['last_login_date'])?'':$user_data['tbl_account']['last_login_date']?></td>
                    </tr>
                </table>
            </div>
            <div class="account_info_div_left_two">
                <div class="div_title"><?php echo __(LANG_CHARACTER_LIST)?></div>
                <table>
                    <tr>
                        <th style="width: 30px"><?php echo __(LANG_NUM)?></th>
                        <th><?php echo __(LANG_NAME)?></th>
                        <th style="width: 83px"><?php echo __(LANG_TYPE)?></th>
                        <th style="width: 43px"><?php echo __(LANG_LEVEL)?></th>
                    </tr>
                    <?php if(!empty($user_character_list)) {?>
                        <?php $num = '';?>
                        <?php foreach($user_character_list as $num => $character) {?>
                            <tr>
                                <td class="user_link">
                                    <?php echo $this->Html->link($num+1, array(
                                            'action' => 'user_select',
                                            'id' => $character['tbl_character']['a2x_id'],
                                            'char_serial' => $character['tbl_character']['char_serial'],
                                            'search_value' => $this->passedArgs['search_value'],
                                        ));?>
                                </td>
                                <td class="user_link">
                                    <?php echo $this->Html->link($character['tbl_character']['char_name'], array(
                                        'action' => 'user_select',
                                        'id' => $character['tbl_character']['a2x_id'],
                                        'char_serial' => $character['tbl_character']['char_serial'],
                                        'search_value' => $this->passedArgs['search_value'],
                                    ));?>
                                </td>
                                <td class="user_link">
                                    <?php echo $this->Html->link($character['tbl_character']['char_type'], array(
                                        'action' => 'user_select',
                                        'id' => $character['tbl_character']['a2x_id'],
                                        'char_serial' => $character['tbl_character']['char_serial'],
                                        'search_value' => $this->passedArgs['search_value'],
                                    ));?>
                                </td>
                                <td class="user_link">
                                    <?php echo $this->Html->link($character['tbl_character']['level'], array(
                                        'action' => 'user_select',
                                        'id' => $character['tbl_character']['a2x_id'],
                                        'char_serial' => $character['tbl_character']['char_serial'],
                                        'search_value' => $this->passedArgs['search_value'],
                                    ));?>
                                </td>
                            </tr>
                        <?php }?>
                    <?php }?>
                </table>
            </div>

            <div class="account_info_div_left_three">
                <?php if(empty($this->passedArgs['char_serial'])) {?>
                    <div class="div_title"><?php echo __(LANG_CHARACTER_INFO)?></div>
                    <p class="info_empty_text "><?php echo __(LANG_CHOOSE_CHAR)?></p>
                <?php }?>
                <?php if(!empty($this->passedArgs['char_serial'])) {?>
                    <div class="div_title"><?php echo __(LANG_CHARACTER_INFO . '(' . $character['tbl_character']['char_name'] . ')')?></div>
                    <table>
                        <tr>
                            <th class="user" style="width: 110px"><?php echo __(LANG_GOLD)?></th>
                            <td ><?php echo $character['tbl_character']['gold']?></td>
                        </tr>
                        <tr>
                            <th class="user"><?php echo __(LANG_ENERGY)?></th>
                            <td ><?php echo $character['tbl_character']['energy']?></td>
                        </tr>
                        <tr>
                            <th class="user"><?php echo __(LANG_EXP)?></th>
                            <td ><?php echo $character['tbl_character']['exp']?></td>
                        </tr>
                        <tr>
                            <th class="user"><?php echo __(LANG_LAST_SAVE)?></th>
                            <td ><?php echo $character['tbl_character']['last_save_date']?></td>
                        </tr>
                    </table>
                <?php }?>
            </div>
        </div>
        <div class="account_info_div_right">
            <div class="account_info_div_right_one">
                <?php if(empty($char_item_list)) {?>
                    <div class="div_title"><?php echo __(LANG_ITEM_INFO)?></div>
                    <div class="table_overflow">
                        <p class="info_empty_text "><?php echo __(LANG_CHOOSE_CHAR)?></p>
                    </div>
                <?php }?>
                <?php if(!empty($char_item_list)) {?>
                    <div class="div_title"><?php echo __(LANG_ITEM_INFO . '(' . $character['tbl_character']['char_name'] . ')')?></div>
                    <div class="table_overflow">
                        <table>
                            <tr>
                                <th style="width: 40px"><?php echo __(LANG_NUM)?></th>
                                <th><?php echo __(LANG_ITEM_ID)?></th>
                                <th><?php echo __(LANG_ITEM_SERIAL)?></th>
                                <th><?php echo __(LANG_ITEM_COUNT)?></th>
                                <th><?php echo __(LANG_ITEM_EQ)?></th>
                            </tr>
                            <?php $num = ''; $count = count($char_item_list);?>
                            <?php foreach($char_item_list as $num => $item) {?>
                                <tr>
                                    <td><?php echo $count--?></td>
                                    <td><?php echo $item['tbl_item']['item_id']?></td>
                                    <td><?php echo $item['tbl_item']['item_serial']?></td>
                                    <td><?php echo $item['tbl_item']['count']?></td>
                                    <td><?php echo $item['tbl_item']['eq']?></td>
                                </tr>
                            <?php }?>
                        </table>
                    </div>
                <?php }?>
            </div>
            <div class="account_info_div_right_two">
                <?php if(empty($char_card_list)) {?>
                    <div class="div_title"><?php echo __(LANG_CARD_INFO)?></div>
                    <div class="table_overflow">
                        <p class="info_empty_text "><?php echo __(LANG_CHOOSE_CHAR)?></p>
                    </div>
                <?php }?>
                <?php if(!empty($char_card_list)) {?>
                    <div class="div_title">
                        <?php echo __(LANG_CARD_INFO . '(' .
                            $character['tbl_character']['char_name'] . ')' . '[' . count($char_card_list) . ']')?>
                    </div>
                    <div class="table_overflow">
                        <table>
                            <tr>
                                <th style="width: 40px"><?php echo __(LANG_NUM)?></th>
                                <th><?php echo __(LANG_CARD_ID)?></th>
                                <th><?php echo __(LANG_LEVEL)?></th>
                                <th><?php echo __(LANG_ITEM_EQ)?></th>
                            </tr>
                            <?php $num = ''; $count = count($char_card_list);?>
                            <?php foreach($char_card_list as $num => $card) {?>
                                <tr>
                                    <td><?php echo $count--?></td>
                                    <td><?php echo $card['tbl_card']['card_id']?></td>
                                    <td><?php echo $card['tbl_card']['level']?></td>
                                    <td><?php echo $card['tbl_card']['eq']?></td>
                                </tr>
                            <?php }?>
                        </table>
                    </div>
                <?php }?>
            </div>
        </div>
        <div class="account_info_div_bottom">
            <div class="account_info_div_bottom_one">
                <?php if(empty($user_billing_list)) {?>
                    <div class="div_title"><?php echo __(LANG_BILLING_INFO)?></div>
                    <div>
                        <p class="info_empty_text "><?php echo __(LANG_PAYMENT_NOTHING)?></p>
                    </div>
                <?php }?>
                <?php if(!empty($user_billing_list)) {?>
                    <div class="div_title"><?php echo __(LANG_BILLING_INFO . '(' . $character['tbl_character']['char_name'] . ')')?></div>
                    <div>
                        <table>
                            <tr>
                                <th style="width: 40px"><?php echo __(LANG_NUM)?></th>
                                <th style="width: 290px"><?php echo __(LANG_ORDER_ID)?></th>
                                <th><?php echo __(LANG_PAY_AMOUNT)?></th>
                                <th style="width: 155px"><?php echo __(LANG_PAY_DATE)?></th>
                            </tr>
                            <?php $num = ''; $count = count($user_billing_list);?>
                            <?php foreach($user_billing_list as $num => $billing) {?>
                                <tr>
                                    <td><?php echo $count--?></td>
                                    <td><?php echo $billing['tbl_billing_log']['order_id']?></td>
                                    <td><?php echo $billing['tbl_billing_log']['cash']?></td>
                                    <td><?php echo $billing['tbl_billing_log']['reg_date']?></td>
                                </tr>
                            <?php }?>
                        </table>
                    </div>
                <?php }?>
            </div>
        </div>
    </div>
</div>

